#include "config.h"
#include "ui_config.h"
#include <QSettings>

Config::Config(QWidget *parent): QWidget(parent), ui(new Ui::Config)
{
    ui->setupUi(this);
    initConfig();
}

Config::~Config()
{
    delete ui;
}

void Config::initConfig()
{
    QSettings settings("config.ini", QSettings::IniFormat);

    this->ROW_FIRST_COURSE_INFO_ON_GRADE = settings.value("ROW/FIRST_COURSE_INFO_ON_GRADE").toInt();
    this->ROW_FIRST_STUDENT_ID_ON_GRADE = settings.value("ROW/FIRST_STUDENT_ID_ON_GRADE").toInt();
    this->ROW_FIRST_STUDENT_NAME_ON_GRADE = settings.value("ROW/FIRST_STUDENT_NAME_ON_GRADE").toInt();
    this->ROW_FIRST_STUDENT_ID_ON_CHARITY = settings.value("ROW/FIRST_STUDENT_ID_ON_CHARITY").toInt();
    this->ROW_FIRST_STUDENT_ID_ON_CONDUCT = settings.value("ROW/FIRST_STUDENT_ID_ON_CONDUCT").toInt();
    this->COL_FIRST_COURSE_INFO_ON_GRADE = settings.value("COL/FIRST_COURSE_INFO_ON_GRADE").toInt();
    this->COL_FIRST_STUDENT_ID_ON_GRADE = settings.value("COL/FIRST_STUDENT_ID_ON_GRADE").toInt();
    this->COL_FIRST_STUDENT_NAME_ON_GRADE = settings.value("COL/FIRST_STUDENT_NAME_ON_GRADE").toInt();
    this->COL_FIRST_STUDENT_ID_ON_CHARITY = settings.value("COL/FIRST_STUDENT_ID_ON_CHARITY").toInt();
    this->COL_FIRST_STUDENT_ID_ON_CONDUCT = settings.value("COL/FIRST_STUDENT_ID_ON_CONDUCT").toInt();
    this->COL_CHARITY_SCORE_ON_CHARITY = settings.value("COL/CHARITY_SCORE_ON_CHARITY").toInt();
    this->COL_CONDUCT_SCORE_ON_CONDUCT = settings.value("COL/CONDUCT_SCORE_ON_CONDUCT").toInt();

    // qDebug()<<this->ROW_FIRST_COURSE_INFO_ON_GRADE;
    // qDebug()<<this->ROW_FIRST_STUDENT_ID_ON_GRADE;
    // qDebug()<<this->ROW_FIRST_STUDENT_NAME_ON_GRADE;
    // qDebug()<<this->ROW_FIRST_STUDENT_ID_ON_CHARITY;
    // qDebug()<<this->ROW_FIRST_STUDENT_ID_ON_CONDUCT;
    // qDebug()<<this->COL_FIRST_COURSE_INFO_ON_GRADE;
    // qDebug()<<this->COL_FIRST_STUDENT_ID_ON_GRADE;
    // qDebug()<<this->COL_FIRST_STUDENT_NAME_ON_GRADE;
    // qDebug()<<this->COL_FIRST_STUDENT_ID_ON_CHARITY;
    // qDebug()<<this->COL_FIRST_STUDENT_ID_ON_CONDUCT;
    // qDebug()<<this->COL_CHARITY_SCORE_ON_CHARITY;
    // qDebug()<<this->COL_CONDUCT_SCORE_ON_CONDUCT;
}
